<?php

include 'flinks.php';
$num = 10;
shuffle($flinks);
$html = '';
for ($i = 0; $i < $num; $i++)
{
    $link = $flinks[$i];
    if ($link)
    {
        $url = $link['url'];
        $keywords = $link['keywords'];
        $keywords = explode(',', $keywords);
        $title = array_rand($keywords);
        $anchor = array_rand($keywords);
        $html.='<li><a  target="_blank" href="' . $url . '" title="' . $keywords[$title] . '">' . $keywords[$anchor] . '</a></li>'."\r\n";
    }
}
echo '<ul>' . $html . '</ul>';
echo '<br/>';
echo '<textarea cols="150" rows="15">' . $html . '</textarea>';
?>